package demo.concurrent.thread;

/**
 * 线程例子
 */
public class ThreadDemo {

    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            System.out.println("线程执行");
        });
        System.out.println(thread.getState());
        thread.start();
        System.out.println(thread.getState());
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(thread.getState());
        Runtime.getRuntime().availableProcessors();
    }

}
